<!DOCTYPE html>
<html lang='en'>

<head>
    <meta charset='UTF-8'>
    <meta http-equiv='X-UA-Compatible' content='IE=edge'>
    <meta name='viewport' content='width=device-width, initial-scale=1.0'>
    <title>Document</title>
    <script src='./vue.js'></script>
</head>

<body>
    <div id='app'>

        <label for=""> 篮球</label>
        <input type="checkbox" name="" id="" value='0' v-model='hobbies'>
        <label for=""> 足球</label>
        <input type="checkbox" name="" id="" value='1' v-model='hobbies'>
        <label for=""> 地球 </label>
        <input type="checkbox" name="" id="" value='2' v-model='hobbies'>



    </div>
    <script>
        let vm = new Vue({
            el: '#app',
            data: {
                hobbies: [0, 1]

            },
        })

        setInterval(() => {
            let arr = []
            let leg = Math.floor(Math.random() * 3)
            console.log(leg);

            for ( let  i= 0; i <= leg; i++) {
                arr.push(i)
            }
            vm.hobbies = arr;

        }, 1000)


    </script>
</body>

</html>